package com.lesso.yjy.sunflower.controller;

import com.lesso.yjy.sunflower.HelloService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello")
public class HelloController {
    @DubboReference
    private HelloService helloService;

    @GetMapping
    public ResponseEntity<String> web() {
        return ResponseEntity.ok("hello web");
    }

    @GetMapping("/service")
    public ResponseEntity<String> service() {
        return ResponseEntity.ok(helloService.hello());
    }
}
